home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip: 2005 Utilities
/
CHIP Utilities 2005.7z
/
CHIP Utilities 2005.iso
/
images
/
arachne.igz
/
arachne.img
/
LEVEL0
/
UTILZ.CAB
/
bin
/
Repci.bat
< prev
next >
Wrap
DOS Batch File
|
2005-01-16
|
6KB
|
177 lines
@if "%debug%"=="" echo off
for %%i in (%tmp%\_pci.*) do if exist %%i del %%i >%tmp%\nul
if "%1"==":" if not "%2"=="" goto %2
:: Repci Begin ::
goto _pcipci
:_pci
:_nic
shift
shift
:_pcipci
if "%2"=="" goto _end
if not exist %1 goto _end
tfind "ret=" <%1 >%tmp%\nul
if errorlevel 1 goto _veryend
xgrep -sv "^[:s]*$" %1 >%tmp%\_pci.bak
xgrep -s "^[:s]*;" %tmp%\_pci.bak >%tmp%\_pci.pci
xgrep -sv "^[:s]*;" %tmp%\_pci.bak >%tmp%\_pci.tmp
if exist %tmp%\_pci.bak del %tmp%\_pci.bak >%tmp%\nul
echo ret="DUM$$NIC" >>%tmp%\_pci.tmp
echo ven=DUMM "DUM$$NIC" >>%tmp%\_pci.tmp
echo dev=DUMM "DUM$$NIC" >>%tmp%\_pci.tmp
:_loop
if exist %tmp%\_pci.0 del %tmp%\_pci.0 >%tmp%\nul
lmod []<%tmp%\_pci.tmp >%tmp%\_pci.0
tfind "=" <%tmp%\_pci.0 >%tmp%\nul
if errorlevel 1 goto _end
tfind "ret=" "ven=" "dev=" <%tmp%\_pci.0 >%tmp%\nul
if errorlevel 1 goto _lines
if exist %tmp%\_pci.bak del %tmp%\_pci.bak >%tmp%\nul
lmod [$2 U][=14][$8]<%tmp%\_pci.0 >%tmp%\_pci.bak
type %tmp%\_pci.0 >>%tmp%\_pci.pci
tfind /e "DUM$$NIC" <%tmp%\_pci.bak >%tmp%\nul
if errorlevel 1 goto _jp1
type %tmp%\_pci.bak
type %tmp%\_pci.bak >>%tmp%\_pci.nic
:_jp1
linex 2- <%tmp%\_pci.tmp >%tmp%\_pci.bak
if errorlevel 1 goto _end
type %tmp%\_pci.bak >%tmp%\_pci.tmp
goto _loop
:_lines
tfind "ret=" <%tmp%\_pci.0 >%tmp%\nul
if errorlevel 1 goto _ven
set pciy=1
set pciz=2
goto _xdo
:_ven
set pciy=2
set pciz=1
:_xdo
linex %pciy% <%tmp%\_pci.tmp >%tmp%\_pci.z
if exist %tmp%\_pci.bak del %tmp%\_pci.bak >%tmp%\nul
lmod [$2 U][=14][-]<%tmp%\_pci.z >%tmp%\_pci.bak
tfind /e "DUM$$NIC" <%tmp%\_pci.bak >%tmp%\nul
if errorlevel 1 goto _jp2
type %tmp%\_pci.bak
type %tmp%\_pci.bak >>%tmp%\_pci.nic
:_jp2
lmod [$1 L]="[$2 U]"[-]<%tmp%\_pci.z >>%tmp%\_pci.pci
linex %pciz% <%tmp%\_pci.tmp >%tmp%\_pci.z
lmod [~32][$1 L]=[$2 U R4] "[$3]"[-]<%tmp%\_pci.z >>%tmp%\_pci.pci
linex 3 <%tmp%\_pci.tmp >%tmp%\_pci.z
if exist %tmp%\_pci.bak del %tmp%\_pci.bak >%tmp%\nul
lmod [$3]<%tmp%\_pci.z >%tmp%\_pci.bak
tfind /e "DUM$$NIC" <%tmp%\_pci.bak >%tmp%\nul
if errorlevel 1 goto _jp3
type %tmp%\_pci.bak
type %tmp%\_pci.bak >>%tmp%\_pci.nic
:_jp3
lmod [~32][$1 L]=[$2 U R4] "[$3]"[-]<%tmp%\_pci.z >>%tmp%\_pci.pci
linex 4- <%tmp%\_pci.tmp >%tmp%\_pci.bak
if errorlevel 1 goto _end
type %tmp%\_pci.bak >%tmp%\_pci.tmp
if exist %tmp%\_pci.dum del %tmp%\_pci.dum >%tmp%\nul
lmod []<%tmp%\_pci.tmp >%tmp%\_pci.dum
tfind /e "="<%tmp%\_pci.dum >%tmp%\nul
if errorlevel 1 goto _xloop
if exist %tmp%\_pci.dum del %tmp%\_pci.dum >%tmp%\nul
lmod /L2* [#] []<%tmp%\_pci.tmp >%tmp%\_pci.dum
tfind "=" <%tmp%\_pci.dum >%tmp%\_pci.$$$
if exist %tmp%\_pci.bat del %tmp%\_pci.bat >%tmp%\nul
lmod set pci_=[$1]<%tmp%\_pci.$$$ >%tmp%\_pci.bat
set pci_=
call %tmp%\_pci.bat
lmod /L1-%pci_% [~32][$1 U R4] ""[-]<%tmp%\_pci.tmp >>%tmp%\_pci.pci
if "%pci_%"=="" goto _end
linex %pci_%- <%tmp%\_pci.tmp >%tmp%\_pci.bak
if errorlevel 1 goto _end
linex 2- <%tmp%\_pci.bak >%tmp%\_pci.tmp
if errorlevel 1 goto _end
:_xloop
echo.>>%tmp%\_pci.pci
goto _loop
:_pnp
if "%3"=="" goto _veryend
if not exist %3 goto _veryend
varset _pci=full >%tmp%\_pci.dum
if exist %tmp%\_cd.bat del %tmp%\_cd.bat >%tmp%\nul
lmod /S=: if "%%1"=="" goto Y[+][$3]:[+]cd [$4][+]goto Z<%tmp%\_pci.dum >%tmp%\_cd.bat
varset _pci=full %tmp% >%tmp%\_pci.dum
lmod /S=: :Y[+][$3]:[+]cd [$4][+]:Z<%tmp%\_pci.dum >>%tmp%\_cd.bat
call %tmp%\_cd.bat
getpci.exe >%tmp%\nul
call %tmp%\_cd.bat x
del %tmp%\_cd.bat
for %%i in (0 1 2 3 4 5 6 7 8 9 _ y z) do if ""=="" set pci%%i=
echo @if "%%debug%%"=="" echo off>%tmp%\_pci.dum
if exist %tmp%\_pci_.bat del %tmp%\_pci_.bat >%tmp%\nul
lmod [][+]if "%%1"==":" if not "%%2"=="" goto %%2<%tmp%\_pci.dum >%tmp%\_pci_.bat
echo 0 >%tmp%\_pci.dum
if exist %tmp%\_pci.$$$ del %tmp%\_pci.$$$ >%tmp%\nul
lmod [$1][+]1[+]2[+]3[+]4[+]5[+]6[+]7[+]8[+]9<%tmp%\_pci.dum >%tmp%\_pci.$$$
lmod /L* if not "%%pci_%%"=="" if "%%pci[$1]%%"=="" call %%0 : Y [$1] %%1 %%2<%tmp%\_pci.$$$ >>%tmp%\_pci_.bat
echo goto Z>%tmp%\_pci.dum
lmod [][+]:Y[+]shift[+]shift[+]set pci%%1=%%2[+]set pci_=[+]echo %%3: %%2[+]goto Z[+]:Z<%tmp%\_pci.dum >>%tmp%\_pci_.bat
for %%i in (%tmp%\*.pci) do if exist %%i call %0 : _fndnic %%i %3
del %tmp%\_pci_.bat
goto _veryend
:_fndnic
shift
shift
echo %1 >%tmp%\_pci.dum
tfind /e "%2" <%tmp%\_pci.dum >%tmp%\nul
if errorlevel 1 goto _veryend
del %1
varset pci_=name %1 /U>%tmp%\_pci.bat
call %tmp%\_pci.bat
varset pciy=string(1,4) %pci_% >%tmp%\_pci.bat
varset pciz=string(5,4) %pci_% >>%tmp%\_pci.bat
call %tmp%\_pci.bat
type %2 >%tmp%\_pci.tmp
:_nicloop
tfind "%pciy%" "%pciz%" <%tmp%\_pci.tmp >%tmp%\_pci.bak
if errorlevel 1 goto _veryend
if exist %tmp%\_pci.dum del %tmp%\_pci.dum >%tmp%\nul
lmod [$4]<%tmp%\_pci.bak >%tmp%\_pci.dum
tfind /e "%pciy%" <%tmp%\_pci.dum >%tmp%\nul
if errorlevel 1 goto _xdev
linex 2- <%tmp%\_pci.bak >%tmp%\_pci.tmp
goto _nicloop
:_xdev
if exist %tmp%\_pci.dum del %tmp%\_pci.dum >%tmp%\nul
lmod []<%tmp%\_pci.bak >%tmp%\_pci.dum
tfind /e " dev=%pciz%" <%tmp%\_pci.dum >%tmp%\_pci.tmp
if errorlevel 1 goto _xsa
if exist %tmp%\_pci.dum del %tmp%\_pci.dum >%tmp%\nul
lmod []<%tmp%\_pci.bak >%tmp%\_pci.dum
tfind /f22 " %pciz%" <%tmp%\_pci.dum >%tmp%\_pci.tmp
if errorlevel 1 goto _veryend
:_xsa
if exist %tmp%\_pci.bat del %tmp%\_pci.bat >%tmp%\nul
lmod call %tmp%\_pci_.bat [$2] %pci_%<%tmp%\_pci.tmp >%tmp%\_pci.bat
call %tmp%\_pci.bat
goto _veryend
:_end
if "%2"=="" goto _n2
if not exist %tmp%\_pci.pci goto _n2
tfind /v "DUM$$NIC" <%tmp%\_pci.pci >%2
:_n2
if "%3"=="" goto _n3
if not exist %tmp%\_pci.nic goto _n3
tfind /v "DUM$$NIC" <%tmp%\_pci.nic >%3
:_n3
:_veryend
for %%i in (%tmp%\_pci.*) do if exist %%i del %%i >%tmp%\nul
set pci_=
set pciy=
set pciz=
:: Repci End ::